<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<title>订单管理 - 订单列表</title>
<style>
 .LeftForm{float:left;width:80%}
.RightForm{float:right;width:20%;}
.exp{margin-top:30px}
.print_word{float:left}
.clearfix{clear: both}
.fahuoren{width:100%}
.shoujianrenren{width:100%}
 </style>

</head> 
<!-- BEGIN BODY -->
<body>
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT> 
<div class="LeftForm">
<div id="print_word" style="margin-bottom:10px;width:500px;height:40px;border-radius:5px;background:#4b8df8;text-align:center;line-height:40px">打印</div>
	<div id="Retain" class="PrintArea">
		<div id="ex_pic" style="background:url('<?php echo  $this->FormType['doc'];?>') no-repeat;width:1000px;height:665px;position:relative;">
            <div id="company_Send"><?php echo $this->sender['send_company'];?></div>
            <div id="sender"><?php echo $this->sender['sender_name'];?></div>
            <div id="address_Send" style="height:40px;background:transparent;border-style:none;"><?php echo $this->sender['send_address'];?></div>
            <div id="Mobile_Send"><?php echo $this->sender['sender_phone'];?></div>
            <div id="goods_send" >
               <table>
               <?php foreach ($this->order['goods'] as $v){?>
                   <tr style="width:350px;height:9px">
                        <td style="width:300px"><?php echo $v['goods_name'];?></td><td style="width:50px;text-align:right;"><?php echo $v['goods_number'];?></td>
                   </tr>
                   <?php }?>
               </table>
            </div>
                        
            <div id="company_Recipient"></div>
            <div id="recipients"><?php echo $this->order['consignee'];?></div>
            <div id="address_Recipient" style="height:40px;background:transparent;border-style:none;"><?php echo $this->order['address'];?></div>
            <div id="Mobile_Recipient" ><?php echo $this->order['tel'];?></div>
         </div>
	</div>
</div>
<div class="RightForm">
 <div class="exp">
   <label  class="">快递公司：</label>
   <select class="expselect" name="expselect" id="_expselect">
        <option value="">--请选择快递公司--</option>
            <?php 
              if($this->Express){
              	foreach ($this->Express as $v){
              	?>
              	   <option value="<?php echo $v['id'];?>"<?php if($this->id['id'] == $v['id']){echo selected;}?>><?php echo $v['express'];?></option>
              	<?php 
              	} }
            ?>
   </select>
   <a href="javascript:butvalue();" ><input type="button" value="设置为默认快递公司"/></a>
 </div>

 <div class="Express_message">
  <table  style="width:500px;height:200px">
      <?php if ($this->order){
      	?>
       <tr>
        <td>商品名称：</td>
        <td><?php echo $this->order['goods_name'];?></td>
	   </tr>
	   <tr>
        <td>收件人：</td>
        <td><?php echo $this->order['consignee'];?></td>
	   </tr>
	   <tr>
        <td>收件单位：</td>
        <td></td>
	   </tr>
	   <tr>
        <td>收件地址：</td>
        <td><?php echo $this->order['address'];?></td>
	   </tr>
	   <tr>
        <td>收件人移动电话：</td>
        <td><?php echo $this->order['tel'];?></td>
	   </tr>
	   <tr>
        <td>件数：</td>
        <td><?php echo $this->order['goods_number'];?></td>
	   </tr>
	   <tr>
        <td>重量：</td>
        <td></td>
	   </tr>
	   <tr>
        <td>资费：</td>
        <td><?php echo $this->order['shipping_fee'];?></td>
	   </tr>
	   <tr>
        <td>发货人：</td>
        <td><?php echo $this->auth['realname'];?></td>
	   </tr>
	   <tr>
        <td>发货单位：</td>
        <td></td>
	   </tr>
	   <tr>
        <td>发货地址：</td>
        <td><?php echo $this->auth['realname'];?></td>
	   </tr>
	   <tr>
        <td>发货人移动电话：</td>
        <td><?php echo $this->auth['mobile'];?></td>
	   </tr>
	   <tr>
        <td>发货日期：</td>
        <td><?php echo $this->order['time'];?></td>
	   </tr>
	   <tr>
        <td>保价费：</td>
        <td></td>
	   </tr>
	   <tr>
        <td>费用总计：</td>
        <td></td>
	   </tr>
	   <tr>
        <td>备注：</td>
        <td><textarea></textarea></td>
	   </tr>
	  <?php  }?>
    </table>
 </div>
 
 <div class="setpic">
 </div>
</div>
<div class="clearfix"></div>
<!--       字体大小:<input type="text" id="font_size"/> -->
<!--       字体间隔:<input type="text" id="font_size"/><br/> -->
</body>
<script type="text/javascript">
var num =  <?php echo $this->num;?>;
var shipping_name = '<?php echo $this->order['shipping_name'];?>';
var cst = '<?php echo $this->FormType['company_Send_top'];?>';
var csl = '<?php echo $this->FormType['company_Send_left'];?>';
var st = '<?php echo $this->FormType['sender_top'];?>';
var sl = '<?php echo $this->FormType['sender_left'];?>';
var ast = '<?php echo $this->FormType['address_Send_top'];?>';
var asl = '<?php echo $this->FormType['address_Send_left'];?>';
var mst = '<?php echo $this->FormType['Mobile_Send_top'];?>';
var msl = '<?php echo $this->FormType['Mobile_Send_left'];?>';
var gst = '<?php echo $this->FormType['goods_send_top'];?>';
var gsl = '<?php echo $this->FormType['goods_send_left'];?>';

var crt = '<?php echo $this->FormType['company_Recipient_top'];?>';
var crl = '<?php echo $this->FormType['company_Recipient_left'];?>';
var rt = '<?php echo $this->FormType['recipients_top'];?>';
var rl = '<?php echo $this->FormType['recipients_left'];?>';
var art = '<?php echo $this->FormType['address_Recipient_top'];?>';
var arl = '<?php echo $this->FormType['address_Recipient_left'];?>';
var mrt = '<?php echo $this->FormType['Mobile_Recipient_top'];?>';
var mrl = '<?php echo $this->FormType['Mobile_Recipient_left'];?>';

var oDiv1 = document.getElementById('company_Send');
oDiv1.style.position="absolute";
oDiv1.style.marginTop = cst+'px';
oDiv1.style.marginLeft = csl+'px';
var oDiv2 = document.getElementById('sender');
oDiv2.style.position="absolute";
oDiv2.style.marginTop = st+'px';
oDiv2.style.marginLeft = sl+'px';
var oDiv3 = document.getElementById('address_Send');
oDiv3.style.position="absolute";
oDiv3.style.marginTop = ast+'px';
oDiv3.style.marginLeft = asl+'px';
oDiv3.style.fontSize = "16px";
var oDiv4 = document.getElementById('Mobile_Send');
oDiv4.style.position="absolute";
oDiv4.style.marginTop = mst+'px';
oDiv4.style.marginLeft = msl+'px';


var oDiv5 = document.getElementById('company_Recipient');
oDiv5.style.position="absolute";
oDiv5.style.marginTop = crt+'px';
oDiv5.style.marginLeft = crl+'px';
var oDiv6 = document.getElementById('recipients');
oDiv6.style.position="absolute";
oDiv6.style.marginTop = rt+'px';
oDiv6.style.marginLeft = rl+'px';
var oDiv7 = document.getElementById('address_Recipient');
oDiv7.style.position="absolute";
oDiv7.style.marginTop = art+'px';
oDiv7.style.marginLeft = arl+'px';
oDiv7.style.fontSize = "16px";
var oDiv8 = document.getElementById('Mobile_Recipient');
oDiv8.style.position="absolute";
oDiv8.style.marginTop = mrt+'px';
oDiv8.style.marginLeft = mrl+'px';
var oDiv9 = document.getElementById('goods_send');
oDiv9.style.position="absolute";
oDiv9.style.marginTop = gst+'px';
oDiv9.style.marginLeft = gsl+'px';
oDiv9.style.fontSize="10px";
oDiv9.style.height="18px";
if(num > 2){
   oDiv9.contentEditable="true";
}else{
	oDiv9.contentEditable="false";
}
if(shipping_name == "顺丰快递"){
	oDiv4.style.fontSize="20px";
	oDiv4.style.letterSpacing ="5px";
	oDiv8.style.fontSize="20px";
	oDiv8.style.letterSpacing ="5px";
	oDiv9.style.width = "380px";
	oDiv7.style.width = "350px";
	oDiv3.style.width = "350px";
}
if(shipping_name == "圆通快递"){
	oDiv4.style.fontSize="20px";
	oDiv8.style.fontSize="20px";
	oDiv9.style.width = "350px";
	oDiv7.style.width = "300px";
	oDiv3.style.width = "280px";
}
if(shipping_name == "中通快递"){
  	oDiv4.style.fontSize="18px";
  	oDiv4.style.letterSpacing ="1px";
  	oDiv3.style.width = "250px";
  	oDiv7.style.width = "250px";
  	oDiv8.style.fontSize="18px";
  	oDiv8.style.letterSpacing ="1px";
  	oDiv9.style.width = "132px";
  	oDiv9.contentEditable="true";
  }
if(shipping_name == "EMS"){
  	oDiv4.style.fontSize="18px";
  	oDiv4.style.letterSpacing ="1px";
  	oDiv3.style.width = "280px";
  	oDiv7.style.width = "280px";
  	oDiv8.style.fontSize="18px";
  	oDiv8.style.letterSpacing ="1px";
  	oDiv9.style.width = "300px";
  if(num > 3){
  		   oDiv9.contentEditable="true";
  		}else{
  			oDiv9.contentEditable="false";
  		}
  }
</script>
 <script src="/style/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script> 
<script src="/style/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
<script src="/style/assets/scripts/jquery-ui-1.10.4.custom.js" type="text/JavaScript"></script>
<script src="/style/assets/scripts/jquery.PrintArea.js" type="text/JavaScript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {    
	$("#_expselect").change(function(){
		var id = $(this).val();
		
		if(id != ''){
			$.post("stampajax",{id:id},function(data){
                  if(data != ''){
                	  document.getElementById("ex_pic").style.backgroundImage="url("+data.doc+")";

                	  var oDiv1 = document.getElementById('company_Send');
                	  oDiv1.style.position="absolute";
                	  oDiv1.style.marginTop = data.company_Send_top+'px';
                	  oDiv1.style.marginLeft = data.company_Send_left+'px';
                	  var oDiv2 = document.getElementById('sender');
                	  oDiv2.style.position="absolute";
                	  oDiv2.style.marginTop = data.sender_top+'px';
                	  oDiv2.style.marginLeft = data.sender_left+'px';
                	  var oDiv3 = document.getElementById('address_Send');
                	  oDiv3.style.position="absolute";
                	  oDiv3.style.marginTop = data.address_Send_top+'px';
                	  oDiv3.style.marginLeft = data.address_Send_left+'px';
                	  oDiv3.style.fontSize = "16px";
                	  var oDiv4 = document.getElementById('Mobile_Send');
                	  oDiv4.style.position="absolute";
                	  oDiv4.style.marginTop = data.Mobile_Send_top+'px';
                	  oDiv4.style.marginLeft = data.Mobile_Send_left+'px';
                	  var oDiv9 = document.getElementById('goods_send');
                	  oDiv9.style.position="absolute";
                	  oDiv9.style.marginTop = data.goods_send_top+'px';
                	  oDiv9.style.marginLeft = data.goods_send_left+'px';
                	  oDiv9.style.fontSize="10px";
                	  oDiv9.style.height="18px";
                	  if(num > 2){
	               		   oDiv9.contentEditable="true";
	               		}else{
	               			oDiv9.contentEditable="false";
	               		}


                	  var oDiv5 = document.getElementById('company_Recipient');
                	  oDiv5.style.position="absolute";
                	  oDiv5.style.marginTop = data.company_Recipient_top+'px';
                	  oDiv5.style.marginLeft = data.company_Recipient_left+'px';
                	  var oDiv6 = document.getElementById('recipients');
                	  oDiv6.style.position="absolute";
                	  oDiv6.style.marginTop = data.recipients_top+'px';
                	  oDiv6.style.marginLeft = data.recipients_left+'px';
                	  var oDiv7 = document.getElementById('address_Recipient');
                	  oDiv7.style.position="absolute";
                	  oDiv7.style.marginTop = data.address_Recipient_top+'px';
                	  oDiv7.style.marginLeft = data.address_Recipient_left+'px';
                	  oDiv7.style.fontSize = "16px";
                	  var oDiv8 = document.getElementById('Mobile_Recipient');
                	  oDiv8.style.position="absolute";
                	  oDiv8.style.marginTop = data.Mobile_Recipient_top+'px';
                	  oDiv8.style.marginLeft = data.Mobile_Recipient_left+'px';
                	  
                	  if(data.shipping_name == "顺丰快递"){
              			oDiv4.style.fontSize="20px";
              			oDiv4.style.letterSpacing ="5px";
              			oDiv8.style.fontSize="20px";
              			oDiv8.style.letterSpacing ="5px";
              			oDiv9.style.width = "380px";
              			oDiv7.style.width = "350px";
              			oDiv3.style.width = "350px";
              		}
              		if(data.shipping_name == "圆通快递"){
              			oDiv4.style.fontSize="20px";
              			oDiv4.style.letterSpacing ="1px";
              			oDiv8.style.fontSize="20px";
              			oDiv8.style.letterSpacing ="1px";
              			oDiv9.style.width = "350px";
              			oDiv7.style.width = "280px";
              			oDiv3.style.width = "280px";
              		}
              		if(data.shipping_name == "中通快递"){
              		  	oDiv4.style.fontSize="18px";
              		  	oDiv4.style.letterSpacing ="1px";
              		  	oDiv3.style.width = "280px";
              		  	oDiv7.style.width = "280px";
              		  	oDiv8.style.fontSize="18px";
              		  	oDiv8.style.letterSpacing ="1px";
              		  	oDiv9.style.width = "132px";
              		  	oDiv9.contentEditable="true";
              		  }
              		if(data.shipping_name == "EMS"){
              		  	oDiv4.style.fontSize="18px";
              		  	oDiv4.style.letterSpacing ="1px";
              		  	oDiv3.style.width = "280px";
              		  	oDiv7.style.width = "280px";
              		  	oDiv8.style.fontSize="18px";
              		  	oDiv8.style.letterSpacing ="1px";
              		  	oDiv9.style.width = "300px";
                		  if(num > 3){
	   	               		   oDiv9.contentEditable="true";
	   	               		}else{
	   	               			oDiv9.contentEditable="false";
	   	               		}
              		  }
                   } 
			},'json');
		}
	});
	jQuery('#_checkboxall').change(function () {
		var checked = jQuery(this).is(":checked");
		jQuery("._checkboxs").each(function () {
			if (checked) {
				$(this).attr("checked", true);
			} else {
				$(this).attr("checked", false);
			}
			$(this).parents('tr').toggleClass("active");
		});
		jQuery.uniform.update("._checkboxs");
	});
	
	$("._checkboxs").change(function() {
        var checked = jQuery(this).is(":checked");
		if (!checked) {			
			$(this).attr("checked", false);
			$(this).parents('tr').removeClass("active");
			$("#_checkboxall").attr("checked",false);
			jQuery.uniform.update("#_checkboxall");
		}
    });
})

function butvalue(){
	id = $('#_expselect option:selected') .val();
	if(id != ''){
		$.post("default_ex_name",{id:id},function(data){
              if(data == 1){
            	    alert("设置成功");
                  }else{
                	  alert("设置失败");
                  }
		});
	}
}

$(document).ready(function(){
    $("div#print_word").click(function(){
    	var oDiv = document.getElementById('ex_pic'); //获取这个div元素
    	oDiv.style.background = '';
        var print ="div.PrintArea#Retain";
        $( print ).printArea();
    });
});

</script>
</html>